﻿package mortal.game.view.forging.renderer
{
    import com.mui.controls.*;
    import mortal.common.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.game.manager.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.display.*;
    import mortal.game.view.common.util.*;

    public class StrengthenPropCellRenderer extends GCellRenderer
    {
        private var _propName:GTextFiled;
        private var _propValue:BitmapNumberText;
        private var _propStrengValue:GTextFiled;

        public function StrengthenPropCellRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            this.mouseEnabled = true;
            this.mouseChildren = true;
            super.createDisposedChildrenImpl();
            this._propName = UIFactory.gTextField("", 0, 0, 45, 20, this, GlobalStyle.textFormatAnHuan);
            this._propValue = UIFactory.bitmapNumberText(50, 6, "RoleInfoNum.png", 8, 10, -1, this, 14);
            this._propStrengValue = UIFactory.gTextField("", 0, 0, 65, 20, this, GlobalStyle.textFormatLv);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            super._data = param1;
            if (param1.hasOwnProperty("propName") && param1.hasOwnProperty("propBaseValue"))
            {
                this._propName.text = param1.propName;
                this._propName.toolTipData = AttributeUtil.getTipsByAttrName(param1.attrName);
                this._propValue.text = param1.propBaseValue + "";
                DisplayUtil.removeMe(this._propStrengValue);
            }
            else
            {
                this._propStrengValue.text = "(+" + param1.propStrengValue + ")";
                DisplayUtil.removeMe(this._propName);
            }
            return;
        }// end function

        public function addTextEffect() : void
        {
            var _loc_1:Array = [FilterConst.colorGlowFilter(GlobalStyle.colorLvUint)];
            EffectManager.glowFilterUnReg(this._propStrengValue);
            EffectManager.glowFilterReg(this._propStrengValue, _loc_1, 1, 10, 0, 3);
            return;
        }// end function

        public function stopTextEffect() : void
        {
            EffectManager.glowFilterUnReg(this._propStrengValue);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._propName.dispose(param1);
            this._propValue.dispose(param1);
            this._propStrengValue.dispose(param1);
            this._propName = null;
            this._propValue = null;
            this._propStrengValue = null;
            return;
        }// end function

    }
}
